package com.fudan.biz.spark.web;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fudan.biz.spark.entity.Submitter;
import com.fudan.biz.spark.service.SubmitterService;
import com.fudan.framework.base.DaoService;
import com.fudan.framework.base.DataController;
import com.fudan.framework.entity.TableJson;

@Controller
@RequestMapping("/biz/spark/conf/submitter")
public class SubmitterController extends DataController<Submitter>{

	@Autowired
	private SubmitterService submitterService;

	@RequestMapping("/list")
	@ResponseBody
	public TableJson list(HttpServletRequest request) {
		return TableJson.build(submitterService.pages(request), submitterService.countAll());
	}

	@Override
	protected DaoService<Submitter> injectService() {
		return submitterService;
	}

	@Override
	protected String pathPrefix() {
		return "/biz/spark";
	}
}
